<script type="text/html" id="projectEditTemplate">
    <form id="projectEditForm" class="layui-form" action="">
        <input type="hidden" name="id" value="{{d.id}}">
        <div class="layui-form-item">
            <label class="layui-form-label">项目名</label>
            <div class="layui-input-block">
                <input type="text" name="projectName" value="{{d.name}}" required
                       lay-verify="required" autocomplete="off" class="layui-input ">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">git地址</label>
            <div class="layui-input-block">
                <input type="text" name="remotePath" value="{{d.remotePath}}" required
                       lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否展示</label>
            <div class="layui-input-block">
                {{# if(d.isShow){ }}
                <input type="checkbox" name="isShow" lay-skin="switch" checked="checked" >
                {{# }else{  }}
                <input type="checkbox" name="isShow" lay-skin="switch">
                {{# } }}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">展示顺序</label>
            <div class="layui-input-block">
                <input type="number" name="displayOrder" value="{{d.displayOrder}}" required
                       lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">配置</label>
            <div class="layui-input-block">
                <table class="layui-table layui-form projectConfigTable" style="margin: 0" lay-size="sm">
                    <thead>
                    <th width="25%">模块</th>
                    <th width="25%">展示名称</th>
                    <th width="20%">端口</th>
                    <th width="30%">上下文路径</th>
                    </thead>
                    {{# d.projectConfigs.forEach(v => { }}
                    <tr data-id="{{v.id||''}}">
                        <td><input name="menuName" type="text" class="layui-input" value="{{v.menuName}}" /></td>
                        <td><input name="name" type="text" class="layui-input" value="{{v.name || ''}}" /></td>
                        <td><input name="port" type="number" class="layui-input" value="{{v.port || ''}}" /></td>
                        <td><input name="contextPath" type="text" class="layui-input" value="{{v.contextPath || ''}}" /></td>
                    </tr>
                    {{# }) }}
                </table>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">分支</label>
            <div class="layui-input-block">
                {{# $.each(d.branchList,(i,v)=>{ }}
                <div class="layui-table-cell laytable-cell-1-0-3 branchListDiv">
                    <div class="layui-col-sm6">{{v.name}}</div>
                    <div class="layui-col-sm6">
                        <i class="layui-icon layui-icon-delete" style="cursor:pointer"
                           onclick="deleteBranch({{d.id}},{{v.id}},0);"></i>
                    </div>

                </div>
                {{# }) }}
                <div class="layui-table-cell laytable-cell-1-0-3 layui-hide deleteBranchDiv">
                    <ul class="layui-code">
                        <li>确定删除吗</li>
                        <li>开始删除</li>
                        <li>当前分支存在API被引用</li>
                        <li>选择替换分支</li>
                        <li>目标分支</li>
                        <li>方案</li>
                        <li>
                            <select>
                                <option>master</option>
                            </select>
                            <button>确定</button>
                        </li>
                    </ul>
                    <btn onclick="deleteBranch(0,0,-1)">取消</btn>
                </div>
            </div>
        </div>
    </form>
</script>